#include "Block.h"

using namespace std;

Block::Block(){}

bool Block::loadBlockFiles(char* BlockFiles)
{
	spriteSurface = Dx.getSurfaceFromBitmap(BlockFiles, bS.m_BlockWidth, bS.m_BlockHeight);
	if (spriteSurface == NULL)
		return false;

		//defines the sprite
		spriteStruct.srcRect.top = 0;
		spriteStruct.srcRect.left = 0; 
		spriteStruct.srcRect.right = spriteStruct.srcRect.left + bS.m_BlockWidth; 
		spriteStruct.srcRect.bottom =spriteStruct.srcRect.top + bS.m_BlockHeight;
		spriteStruct.posX = 0;
		spriteStruct.posY = 0;
		spriteStruct.Direction = 1;
		
		// set the animation data
		spriteStruct.curFrame = 0;
		spriteStruct.numFrames = 4;

		// set the move data
		spriteStruct.moveX = initSpeed;
		spriteStruct.moveY = 0.0;

	return true;
}

int Block::getBHeight()
{
	return bS.m_BlockHeight;
}

int Block::getBWidth()
{
	return bS.m_BlockWidth;
}

void Block::SetHeight(int h)
{
	bS.m_BlockHeight = h;
}

void Block::SetWidth(int w)
{
	bS.m_BlockWidth = w;
}

float Block::getX()
{
	return sT.posX;
}

float Block::getY()
{
	return sT.posY;
}

Block::~Block()
{
}